﻿using System;
using System.IO;
using System.Windows.Forms;

namespace Zove.Scripting.Editor
{
    internal static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (args.Length == 0)
            {
                Application.Run(new ScriptingEditorView());
            }
            else
            {
                if (!File.Exists(args[0]))
                {
                    throw new FileNotFoundException(args[0]);
                }

                Application.Run(new ScriptingEditorView(args[0]));
            }
        }
    }
}